package com.yida.gwj.finance.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.yida.common.core.utils.DateUtils;
import com.yida.gwj.api.domain.GwjFinanceAccountMain;
import com.yida.gwj.finance.mapper.GwjFinanceAccountMainMapper;
import com.yida.gwj.finance.service.IGwjFinanceAccountMainService;

/**
 * 总账流水Service业务层处理
 *
 * @author 缴存业务管理模块
 * @date 2023-01-10
 */
@Service
public class GwjFinanceAccountMainServiceImpl implements IGwjFinanceAccountMainService {
    @Resource
    private GwjFinanceAccountMainMapper gwjFinanceAccountMainMapper;

    /**
     * 查询总账流水
     *
     * @param accountMainId 总账流水主键
     * @return 总账流水
     */
    @Override
    public GwjFinanceAccountMain selectGwjFinanceAccountMainByAccountMainId(Long accountMainId) {
        return gwjFinanceAccountMainMapper.selectGwjFinanceAccountMainByAccountMainId(accountMainId);
    }

    /**
     * 查询总账流水列表
     *
     * @param gwjFinanceAccountMain 总账流水
     * @return 总账流水
     */
    @Override
    public List<GwjFinanceAccountMain> selectGwjFinanceAccountMainList(GwjFinanceAccountMain gwjFinanceAccountMain) {
        return gwjFinanceAccountMainMapper.selectGwjFinanceAccountMainList(gwjFinanceAccountMain);
    }

    /**
     * 新增总账流水
     *
     * @param gwjFinanceAccountMain 总账流水
     * @return 结果
     */
    @Override
    public int insertGwjFinanceAccountMain(GwjFinanceAccountMain gwjFinanceAccountMain) {
        gwjFinanceAccountMain.setCreateTime(DateUtils.getNowDate());
        return gwjFinanceAccountMainMapper.insertGwjFinanceAccountMain(gwjFinanceAccountMain);
    }

    /**
     * 修改总账流水
     *
     * @param gwjFinanceAccountMain 总账流水
     * @return 结果
     */
    @Override
    public int updateGwjFinanceAccountMain(GwjFinanceAccountMain gwjFinanceAccountMain) {
        return gwjFinanceAccountMainMapper.updateGwjFinanceAccountMain(gwjFinanceAccountMain);
    }

    /**
     * 批量删除总账流水
     *
     * @param accountMainIds 需要删除的总账流水主键
     * @return 结果
     */
    @Override
    public int deleteGwjFinanceAccountMainByAccountMainIds(Long[] accountMainIds) {
        return gwjFinanceAccountMainMapper.deleteGwjFinanceAccountMainByAccountMainIds(accountMainIds);
    }

    /**
     * 删除总账流水信息
     *
     * @param accountMainId 总账流水主键
     * @return 结果
     */
    @Override
    public int deleteGwjFinanceAccountMainByAccountMainId(Long accountMainId) {
        return gwjFinanceAccountMainMapper.deleteGwjFinanceAccountMainByAccountMainId(accountMainId);
    }

    /**
     * 通过业务ID删除总账流水信息
     *
     * @param bizId 业务ID
     * @return 结果
     */
    @Override
    public int deleteGwjFinanceAccountMainByBizId(Long bizId) {
        return gwjFinanceAccountMainMapper.deleteGwjFinanceAccountMainByBizId(bizId);
    }

    /**
     * 通过业务ID查询总账流水列表
     *
     * @param bizId 业务ID
     * @return 总账流水集合
     */
    @Override
    public GwjFinanceAccountMain selectGwjFinanceAccountMainByBizId(Long bizId) {
        return gwjFinanceAccountMainMapper.selectGwjFinanceAccountMainByBizId(bizId);
    }

    /**
     * 查询总账流水列表
     *
     * @param financeAccountMain
     * @return 总账流水集合
     */
    @Override
    public GwjFinanceAccountMain getGwjFinanceAccountMain(GwjFinanceAccountMain financeAccountMain) {
        return gwjFinanceAccountMainMapper.getGwjFinanceAccountMain(financeAccountMain);
    }

    @Override
    public int deleteGwjFinanceAccountMain(GwjFinanceAccountMain gwjFinanceAccountMain) {
        return gwjFinanceAccountMainMapper.deleteGwjFinanceAccountMain(gwjFinanceAccountMain);
    }

    /**
     * 修改总账流水信息
     *
     * @param gwjFinanceAccountMain 总账流水
     * @return 结果
     */
    @Override
    public int updateGwjFinanceAccountMainInfo(GwjFinanceAccountMain gwjFinanceAccountMain) {
        gwjFinanceAccountMain.setUpdateTime(DateUtils.getNowDate());
        return gwjFinanceAccountMainMapper.updateGwjFinanceAccountMainInfo(gwjFinanceAccountMain);
    }

}
